package com.mhg.collection.theList;

import java.util.LinkedList;

public class Demo_LinkedList_01 {

	public static void main(String[] args) {
		LinkedList link = new LinkedList();
		link.addFirst("java01");
		link.addFirst("java02");
		link.addFirst("java03");
		System.out.println(link);
		System.out.println(link.getLast());//获取元素
		System.out.println(link.removeFirst());//获取元素 但是该元素会被删除
		System.out.println(link);
		System.out.println(link.get(1));
		LinkedList link2 = new LinkedList();
		link2.add("a");
		link2.addLast("b");
		link2.addFirst("c");
		link2.add(2,"d");
		System.out.println(link2);
	}

}
